package demo;

public class Text2 {
    public static void main(String[] args) {
        boolean greenlight = false;
        boolean yellowlight = false;
        boolean redlight = true;
        if(greenlight){
            System.out.println("go");
        }else if(yellowlight){
            System.out.println("slow");
        }else{
            System.out.println("stop");
        }


    /*当汽车行驶时遇到红绿灯，进行自动判断
     如果红灯亮，就停止
     如果黄灯亮，请减速
     如果绿灯亮，请行驶*/
//        boolean isgreenlight = true;
//        boolean isyellowlight = false;
//        boolean isredlight = false;
//        if (isgreenlight) {
//            System.out.println("go!");
//        }else if (isyellowlight) {
//            System.out.println("slow!");
//        }else if (isredlight) {
//            System.out.println("stop!");
//        }
    }
}
